home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / rss / spawnlp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  630 b   |  43 lines

  1. #ifndef MSDOS
  2.  
  3. #include <stdarg.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7. #include "icrss.h"
  8.  
  9. int _spawnlp (int mode, const char *prog, const char *av0, ...)
  10. {
  11.     va_list
  12.         marker;
  13.     register char
  14.        *nextarg;
  15.     char
  16.         buf [_MAX_PATH * 4];
  17.  
  18.     strcpy (buf, prog);
  19.  
  20.     va_start (marker, av0);
  21.     nextarg = va_arg (marker, char*);
  22.  
  23.     while (nextarg)
  24.     {
  25.         strcat (buf, " ");
  26.         strcat (buf, nextarg);
  27.         nextarg = va_arg (marker, char*);
  28.     }
  29.  
  30.     return (system (buf));
  31. }
  32.  
  33. #ifdef DEBUG
  34. int main ()
  35. {
  36.     _spawnlp (0, "ls", "ls", "*.c", "*.h", NULL);
  37.  
  38.     return (0);
  39. }
  40. #endif
  41.  
  42. #endif
  43.